Search
LinearGradientBrush Constructor (Color, string, Color, string, Number, Rect)
See Also
 






Initializes a new instance of the LinearGradientBrush class.

Namespace: MindFusion.Drawing
File: Brush.js

 Syntax

JavaScript  Copy Code

function LinearGradientBrush (startColor, endColor, [angle, [bounds]])

 Parameters

startColor

Type: Color, string
The starting color of the gradient.

endColor

Type: Color, string
The ending color of the gradient.

angle
Optional.

The angle of the gradient.

bounds
Optional.

Type: Rect
The bounds of the gradient.

 Example

The following code creates three linear brushes to be used by an AreaChart:

JavaScript  Copy Code
// create area brushes
var firstBrush = new Drawing.Brush("#ce0000");
var secondBrush = new Drawing.LinearGradientBrush("#003466", "#000063");
var thirdBrush = new Drawing.LinearGradientBrush("#e0e9e9", "#669acc");

 See Also